package lab02.test21;

/**
 * Created by 阿阿阿阿豪丶 on 2017/10/31.
 */
public class Test {
    public static void main(String[] args) {

        String string = "asadasasdgfwq";
        char cha = 'a';

        int num = 0;
        for (int i = 0; i < string.length(); i++) {
            if (string.charAt(i) == cha) {
                num++;
            }
        }

        System.out.println("asadasasdgfw中a出现的频率为：" + num);
    }
}
